<?php
if (get_the_title($post->ID)=='Certificate Classes') {
// Custom Template for Single Posts in Certificate Classes
include 'single-cert-classes.php';
} else {

global $options;
foreach ($options as $value) {
    if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); }
}
$dateformat = get_option('date_format');
$timeformat = get_option('time_format');
$layout = get_post_meta($post->ID, 'template', true);
get_header(); 
?>

<?php 
//set variables for use in template
$cat_ID = get_cat_ID('Finding Guides');
$cat_link = get_category_link($cat_ID);
?>



  <div id="content">
    <div class="wrap">
    
      <?php wp_reset_query(); 
      if (have_posts()) : while (have_posts()) : the_post(); ?>

      <?php if ($layout != 'full') { ?>
      <div class="column column-narrow">
      
      	<?php 
      	$currCat = get_the_category();
      	$current = $currCat[0]->name;
      	$parent = get_cat_name($currCat[0]->category_parent);
      	
      	//left sidebar heading
    	echo "<p class='heading'>".$parent."</p>";
    	
		//left sidebar menu
		list_cat_posts_all();
		
		?>
      
        <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar: Posts (Left)') ) : ?>&nbsp;<?php endif; ?>
      
      </div><!-- end .column-narrow -->
      <?php } ?>
      
      <div class="column <?php if ($layout == 'double') {echo"column-double column-last ";} if ($layout == 'full') {echo"column-full column-last ";} ?>column-content column-double">
	  	<div id="crumbs">
			<!--?php the_breadcrumb(); ?-->
			<?php
				$args = array(
					'prefix' => '<p>',
					'suffix' => '</p>',
					'title' => __( '', 'breadcrumbs-plus' ),
					'home' => __( 'Home', 'breadcrumbs-plus' ),
					'sep' => '»',
					'front_page' => false,
					'bold' => true,
					'show_blog' => false,
					'echo' => true,
					'singular_post_taxonomy' => 'category',
				);
				breadcrumbs_plus( $args );
			?>
		</div>
      	<h1><?php the_title(); ?></h1>

		<?php
			$inHouse = get_field('in-house_status');
			$format = get_field('format');
			$findingGuides = get_field('finding_guides');
			if (strlen($inHouse)>0 || strlen($format)>0 || strlen($findingGuides)>0) {
				echo "<dl class='tablelike'>";
				echo "<dt>Description/Usage</dt><dd>";
				the_content('');
				echo "</dd>";
				if (strlen($inHouse)>0) {
					echo "<dt>In-House Status</dt><dd>";
					emptyP(the_field('in-house_status'));
					echo "</dd>";
				}
				if (strlen($format)>0) {
					echo "<dt>Format</dt><dd>";
					emptyP(the_field('format'));
					echo "</dd>";
				}
				if (strlen($findingGuides)>0) {
					echo "<dt>Finding Guides</dt><dd>";
					emptyP(the_field('finding_guides'));
					echo "</dd>";
				}
				echo "</dl>";
			}
		?>
        
        <?php the_tags( '<p class="tags"><strong>Tags:</strong> ', ', ', '</p>'); ?>
        <span class="category"><a href='<?php echo $cat_link; ?>'>Show all themes in Finding Guides</a></span>
      
      </div><!-- end .column-content -->

      <?php if ($layout != 'double' && $layout != 'full') { ?><div class="column column-narrow column-last">
      
        <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar: Posts (Right)') ) : ?>&nbsp;<?php endif; ?>
      
      </div><!-- end .column-narrow -->
      <?php } ?>

<?php endwhile; endif; ?>

      <div class="clear">&nbsp;</div>

    </div><!-- end .wrap -->
  </div><!-- end #content -->

<?php get_footer(); ?>
<?php } ?>